package com.neuedu.guide;

/**
 * 循环语句
 */
public class MyWhile {

    /**
     *  num +=1;
 *         num +=2;
 *         num +=3;
 *         ....
 *         num +=  100;
     * @param args
     */
    public static void main(String[] args) {

        int sum = 0 ;
        int i = 1;

        while (i<=100){
            sum += i;
            i++;
        }

        System.out.println("从1 + 100之间的数字和 ： "+sum);


        int doSum = 0 ;
        int j = 105;

        //DO 最少能执行， 先执行，后判断
        do{
            doSum += i;
            System.out.println(" invoke  do while");
        }while (i<=100);

        System.out.println("doSum = " + doSum);

    }
}
